from bs4 import BeautifulSoup
import requests
if __name__ == '__main__':
    f = open('qiutu.html', 'r', encoding='utf-8')
    soup = BeautifulSoup(f, 'lxml')
    # print(soup.a)
    # print(soup.find('a'))
    # print(soup.find('a',class_='voting'))
    # print('-'*20)
    # print(soup.find_all('meta'))
    # print(soup.select('.number'))
    print(soup.select('#index_header > ul a')[2])
    print(soup.select('#index_header > ul a')[2].get_text())
    print(soup.select('#index_header > ul a')[2]['href'])
    f.close()